package com.czollmann.android.utils;

import com.czollmann.android.Constants;

import android.database.Cursor;
import android.util.Log;

public class LogUtils {
  public static void debuglog(String message) {
    Log.d(Constants.TAG, message);
  }

  public static void infolog(String message) {
    Log.i(Constants.TAG, message);
  }

  public static void errorlog(Exception e) {
    Log.e(Constants.TAG, e.toString(), e);
  }

  public static void errorlog(String message) {
    Log.e(Constants.TAG, message);
  }

  public static void cursorlog(Cursor cursor) {
    for (boolean hasData = cursor.moveToFirst(); hasData; hasData = cursor.moveToNext()) {
      for (String name : cursor.getColumnNames()) {
        Log.i(Constants.TAG, name + "--> "
                  + cursor.getString(cursor.getColumnIndexOrThrow(name)));
      }
    }
  }
}
